/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author USER
 */
@Entity
@Table(name = "calisantip")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Calisantip.findAll", query = "SELECT c FROM Calisantip c"),
    @NamedQuery(name = "Calisantip.findByIdCalisanTip", query = "SELECT c FROM Calisantip c WHERE c.idCalisanTip = :idCalisanTip"),
    @NamedQuery(name = "Calisantip.findByTipAd", query = "SELECT c FROM Calisantip c WHERE c.tipAd = :tipAd"),
    @NamedQuery(name = "Calisantip.findByBiletYetki", query = "SELECT c FROM Calisantip c WHERE c.biletYetki = :biletYetki"),
    @NamedQuery(name = "Calisantip.findByAdminYetki", query = "SELECT c FROM Calisantip c WHERE c.adminYetki = :adminYetki")})
public class Calisantip implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idCalisanTip")
    private Integer idCalisanTip;
    @Basic(optional = false)
    @Column(name = "tipAd")
    private String tipAd;
    @Basic(optional = false)
    @Column(name = "biletYetki")
    private boolean biletYetki;
    @Basic(optional = false)
    @Column(name = "adminYetki")
    private boolean adminYetki;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "calisanTipId")
    private Collection<Calisan> calisanCollection;

    public Calisantip() {
    }

    public Calisantip(Integer idCalisanTip) {
        this.idCalisanTip = idCalisanTip;
    }

    public Calisantip(Integer idCalisanTip, String tipAd, boolean biletYetki, boolean adminYetki) {
        this.idCalisanTip = idCalisanTip;
        this.tipAd = tipAd;
        this.biletYetki = biletYetki;
        this.adminYetki = adminYetki;
    }

    public Integer getIdCalisanTip() {
        return idCalisanTip;
    }

    public void setIdCalisanTip(Integer idCalisanTip) {
        this.idCalisanTip = idCalisanTip;
    }

    public String getTipAd() {
        return tipAd;
    }

    public void setTipAd(String tipAd) {
        this.tipAd = tipAd;
    }

    public boolean getBiletYetki() {
        return biletYetki;
    }

    public void setBiletYetki(boolean biletYetki) {
        this.biletYetki = biletYetki;
    }

    public boolean getAdminYetki() {
        return adminYetki;
    }

    public void setAdminYetki(boolean adminYetki) {
        this.adminYetki = adminYetki;
    }

    @XmlTransient
    public Collection<Calisan> getCalisanCollection() {
        return calisanCollection;
    }

    public void setCalisanCollection(Collection<Calisan> calisanCollection) {
        this.calisanCollection = calisanCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCalisanTip != null ? idCalisanTip.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Calisantip)) {
            return false;
        }
        Calisantip other = (Calisantip) object;
        if ((this.idCalisanTip == null && other.idCalisanTip != null) || (this.idCalisanTip != null && !this.idCalisanTip.equals(other.idCalisanTip))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Calisantip[ idCalisanTip=" + idCalisanTip + " ]";
    }
    
}
